<?php
$PurviewLevel=0;
require("../../inc/common.inc.php");
require_once(dirname(__FILE__)."/../"."Admin_ChkPurview.php");
if($cid=="tmsgid"||$cid=="rmsgid"){
$msginfo = $db->getinfo("select * from mx_sucai_msg where mid='$id' limit 1");
$mpic = $db->getinfo("select fpath from mx_sucai_file where fid = ".$msginfo["mpic"]." limit 1");
$mtypestr = $msginfo["mtype"]==1?"多图文":"单图文";
$returnstr = '<table width="98%" border="0" align="center" cellpadding="9" cellspacing="1" bgcolor="#CCCCCC" class="stripe">
			  <tr>
                <th width="15%" align="center" class="table_ti">信息类型</th>
				<th align="center" class="table_ti">标题</th>
				<th width="15%" align="center" class="table_ti">封面</th>
                <th width="15%" align="center" class="table_ti">添加时间</th>
			  </tr>
			  <tr>
				<td align="center" bgcolor="#FFFFFF" class="font14">'.$mtypestr.'</td>
				<td align="left" bgcolor="#FFFFFF" class="font14">'.wordscut($msginfo["mtitle"],80,"...").'</a></td>
				<td align="center" bgcolor="#FFFFFF"><img src="'.get_photourl($mpic["fpath"]).'" style="max-width:100px;"/></td>
				<td align="center" bgcolor="#FFFFFF" class="font12">'.date("Y-m-d",$msginfo["addtime"]).'</td>
			  </tr>';
if($msginfo["mtype"]=1){
	$smsgquery = $db->excu("select * from mx_sucai_msg where fid=".$msginfo["mid"]." order by addtime,mid");
	
	while($smsgarr = $db->fetch_array($smsgquery)){
		$mpic = $db->getinfo("select fpath from mx_sucai_file where fid = ".$smsgarr["mpic"]." limit 1");
		$returnstr.='<tr>
				<td align="center" bgcolor="#FFFFFF" class="font14"></td>
				<td align="left" bgcolor="#FFFFFF" class="font14">'.wordscut($smsgarr["mtitle"],80,"...").'</a></td>
				<td align="center" bgcolor="#FFFFFF"><img src="'.get_photourl($mpic["fpath"]).'" style="max-width:100px;"/></td>
				<td align="center" bgcolor="#FFFFFF" class="font12">'.date("Y-m-d",$smsgarr["addtime"]).'</td>
			  </tr>';
	}
}
$returnstr.='</table>';
echo $returnstr;
exit;
}else{
$sucaiinfo = $db->getinfo("select * from mx_sucai_file where fid='$id' limit 1");
if($sucaiinfo["ftype"]==2){
echo "<table width='98%' border='0' align='center' cellpadding='9' cellspacing='1' bgcolor='#CCCCCC' class='stripe'>
			  <tr>
                <th align='center' class='table_ti'>素材名称</th>
				<th width='15%' align='center' class='table_ti'>缩略图</th>
                <th width='10%' align='center' class='table_ti'>大小</th>
                <th width='20%' align='center' class='table_ti'>添加时间</th>
			  </tr>
			  <tr>
				<td align='center' bgcolor='#FFFFFF' class='font14'>".$sucaiinfo['fname']."</td>
				<td align='center' bgcolor='#FFFFFF'><img src='".$sucaiinfo['fpath']."' style='max-width:100px;'/></td>
                <td align='center' bgcolor='#FFFFFF' class='font14'>".round($sucaiinfo['fsize']/1024,2)."k</td>
				<td align='center' bgcolor='#FFFFFF' class='font12'>".date('Y-m-d',$sucaiinfo['addtime'])."</td>
			  </tr>
			</table><br /><br />";
exit;
}else{
echo "<table width='98%' border='0' align='center' cellpadding='9' cellspacing='1' bgcolor='#CCCCCC' class='stripe'>
			  <tr>
                <th align='center' class='table_ti'>素材名称</th>
                <th width='10%' align='center' class='table_ti'>大小</th>
                <th width='20%' align='center' class='table_ti'>添加时间</th>
			  </tr>
			  <tr>
				<td align='center' bgcolor='#FFFFFF' class='font14'>".$sucaiinfo['fname']."</td>
                <td align='center' bgcolor='#FFFFFF' class='font14'>".round($sucaiinfo['fsize']/1024,2)."k</td>
				<td align='center' bgcolor='#FFFFFF' class='font12'>".date('Y-m-d',$sucaiinfo['addtime'])."</td>
			  </tr>
			</table><br /><br />";	
exit;
}
}
?>